<script setup>
    // provide 把父组件得数据传递给所有子组件
    import { ref, provide } from "vue";
    import Header from "./header.vue";

    const web = {
        name: "laoda",
        url: "www.laoda.com"
    }
    // 提供对象
    provide("provideWeb", web)
    // 提供基础类型
    const user = ref(0)
    provide("provideUser", user)
    // 提供函数
    const userAdd = ()=>{
        user.value++
    }
    provide("provideFuncUserAdd", userAdd)

</script>

<template>
    <h3>top2bottom - Top组件</h3>

    user: {{ user }}

    <!-- 子组件 -->
    <Header />

</template>

<style scoped>

</style>